# coding=utf-8
"""
子序列不一定连续
"""
def lis(*args, num=1):
    d = [0] * len(args)
    len_num = 1
    for i in range(len(args)):
        d[i] = 1
        for j in range(i):
            if args[j] <= args[i] and d[i] < d[j] + 1:
                d[i] = d[j] + 1
            if d[i] > len_num:
                len_num = d[i]
    return len_num-1


print(lis(5, 3, 4, 8, 6, 7, 11, 22, 8))
